<?php

/**
 *  @FileComment            [文件注释内容模板]
 *  @ProjectName             项目名称：shopFrame
 *  @FileName                   文件名称：CateTypeBrandViewModel.class.php
 *  @Author                       yuerengui <596580041@qq.com>
 *  @Date                          2014-10-16 1:09:25
 *  *
 */
class CateTypeBrandViewModel extends ViewModel {

        public $table = 'brand';
        public $view = array(
            'brand' => array('_type' => 'INNER'),
            'type' => array('_type' => 'INNER', '_on' => '__brand__.type_tid=type.tid'),
            'category' => array('_type' => 'INNER', '_on' => '__category__.type_tid=type.tid')
        );

        public function get_cid_data($cid) {
                return $this->group('bid')->where('cid=' . $cid)->all();
        }

        public function get_bid_data($bid) {
                return $this->group('bid')->where('bid=' . $bid)->all();
        }

        public function get_tid_data($tid) {
                return $this->group('bid')->where('tid=' . $tid)->all();
        }

}
